//
//  CommonTools.swift
//  weibo
//
//  Created by Apple on 16/3/9.
//  Copyright © 2016年 KY. All rights reserved.
//

import UIKit

//  切换跟视图控制器的通知
let CZSwitchRootVCNotifation = "CZSwitchRootVCNotifation"
//  点击表情插入表情文本的通知
let CZEmoticonNotification = "CZEmoticonNotification"
//  点击删除按钮发送的通知
let CZDeleteEmoticonNotification = "CZDeleteEmoticonNotification"
let ScreenWidth = UIScreen.mainScreen().bounds.width
let ScreenHight = UIScreen.mainScreen().bounds.height

//  根据RGB生成颜色
func RGB(red: CGFloat, green: CGFloat, blue: CGFloat) -> UIColor{
    
    //  red,green,blue，取值范围是0~1
    let rgb = UIColor(red: red / 255, green: green / 255, blue: blue / 255, alpha: 1)

    return rgb
    
}

//  产生随机颜色
func RandomColor() -> UIColor {
    //  产生的随机数0~255
    return RGB(CGFloat(random() % 256), green: CGFloat(random() % 256), blue: CGFloat(random() % 256))
}